#!/usr/bin/env python
import sys
import os
import random

# Setup. 
numVars = 1000;
numObs = 2357;
arity = 5;
childArity = 2;
outputFile = "rand_" + str(numVars) + "x" + str(numObs) + '.tab';
f = open(outputFile,'w');

# Create header. 
f.write("\t".join(['V' + str(i) for i in xrange(numVars)]) + "\n");

# Create discrete row.
f.write("\t".join(['d' for i in xrange(numVars)]) + "\n");

# Create class row.
f.write('class\t');
f.write("\t".join(['' for i in xrange(numVars-1)]) + "\n");

# Begin generating random data.
for i in xrange(numObs):
  # Write class data.
  f.write(str(random.randint(0,childArity-1)));
  
  # Write normal data.
  for i in xrange(numVars-1):
    f.write("\t" + str(random.randint(0,arity-1)));
  f.write('\n');
  
# Done, close.
f.close();